"""
高级特性
  列表生成式：

    列表求平方：
"""
#普通实现：
num = [1,2,3,4,5]
newnum = []
for i in num:
    newnum.append(i**2)

print(newnum)

#高级实现：
num1 =[1,2,3,4,5]
newnum1 = [i ** 2 for i in num1]
print(newnum1)


"""
列表合并：
"""

list1 = ["A","B","C","D"]
list2 = ["a","b","c","d"]
newlist = []
for m in list1:
    for n in list2:
        newlist.append(m+n)
print(newlist)

list3 = ["A1","B2","C3","D4"]
list4 = ["a","b","c","d"]
newlist2 = [m+n for m in list3 for n in list4]
print(newlist2)